import {ObjectDto, ObjectDtoInterface} from "../../../services/sqliteDB/object.dto";
import { TableColumnType } from "../../../services/sqliteDB/object.dto";
import {SyncStatus} from "../../sync-status";

export class InspectionRecordsDto extends ObjectDto implements ObjectDtoInterface {
    public recordsId: number = null;
    public taskId: string = null; // 检修任务Id
    public author: string = null;  // 检修任务编号
    public inspectedDate: number  = null;      // 勘察日期
    public company: string = null;     // 勘察单位名字
    public noteTaker: string = null;  // 记录人
    public noteTakerId: string = null;  // 记录人 Id
    public stackHolder: string = null;       // 勘察负责人名字
    public stackHolderId: string = null;      // 勘察负责人Id
    public memberIds: string  = null;      // 勘察人员的Id列表 ，逗号分隔
    public members: string = null;        // 勘察人员的名字，逗号分隔
    public taskContent: string = null;     // 勘察任务内容
    public workingArea: string = null;      // 工作区域
    public workingAreaDeviceId: string = null;       // 工作区域关联的设备Id
    public powerCutScope: string = null;       // 停电区域
    public powerCutScopeDeviceId: string = null;     // 停电区域关联的设备Id
    public powerCutDevices: string = null;      // 停电设备
    public powerCutDeviceIds: string = null;       // 停电设备Id列表，逗号分隔
    public stateGrounding: string = null;       // 应挂状态接地
    public workGrounding: string = null;       // 应挂工作接地
    public keepLivePowerDevicePositions: string = null;       // 保留带电部位
    public badges: string = null;       // 应悬挂标识牌
    public planedStartedTime: number = null;       // 计划开始时间
    public planedEndTime: number = null;       // 计划结束时间
    public powerCutHours: number = null;       // 计划停电小时数
    public stopPowerStartTime: number = null; // 计划停电开始时间
    public stopPowerEndTime: number = null; // 计划停电结束时间
    public supplyPowerStartTime: number = null; // 计划送电开始时间
    public supplyPowerEndTime: number = null; // 计划送电结束时间
    public isChangingPowerLine: boolean = null;       // 是否转供电
    public changingPowerLineInfo: string  = null;      // 转供电相关信息
    public isAdjacentLines: boolean = null;       // 邻近线路是否供电
    public adjacentLinesRemark: string = null;       // 邻近线路备注
    public crossLineInfo: string  = null;      // 停电区域交叉跨越情况
    public hasDoublePowers: boolean  = null;      // 停电区域有无双电源，自备电源用户
    public devicesUnderGround: boolean   = null;     // 工作区域的地下管线设施
    public risks: string  = null;     // 作业危险点
    public riskLevel: string = null;      // 作业风险等级
    public powerCutDiagram: string   = null;   // 停电示意图
    public saveLocaTime: number = null;   // 保存到本地时间
    public submitServeTime: number = null; // 提交到服务器时间
    public pictureAttachmentIds: string   = null;     // 现成图片附件Id列表，逗号分隔
    public syncStatus: SyncStatus = SyncStatus.None;       // 同步状态：   （0: 从来没上传, 1: 上传成功, 2: 正在上传, 3: 上传失败)


    constructor() {
        super();
    }

    table() {
        return {
            tableName: "InspectionRecords",
            tableConstructor: {
                recordsId: TableColumnType.int,
                taskId: `${TableColumnType.text} ${TableColumnType.unique}`,
                author: TableColumnType.text,
                inspectedDate: TableColumnType.int,
                noteTaker: TableColumnType.text,
                noteTakerId: TableColumnType.text,
                company: TableColumnType.text,
                stackHolder: TableColumnType.text,
                stackHolderId: TableColumnType.text,
                memberIds: TableColumnType.text,
                members: TableColumnType.text,
                taskContent: TableColumnType.text,
                workingArea: TableColumnType.text,
                workingAreaDeviceId: TableColumnType.text,
                powerCutScope: TableColumnType.text,
                powerCutScopeDeviceId: TableColumnType.text,
                powerCutDevices: TableColumnType.text,
                powerCutDeviceIds: TableColumnType.text,
                stateGrounding: TableColumnType.text,
                workGrounding: TableColumnType.text,
                keepLivePowerDevicePositions: TableColumnType.text,
                badges: TableColumnType.text,
                planedStartedTime: TableColumnType.int,
                planedEndTime: TableColumnType.int,
                powerCutHours: TableColumnType.int,
                stopPowerStartTime: TableColumnType.int,
                stopPowerEndTime: TableColumnType.int,
                supplyPowerStartTime: TableColumnType.int,
                supplyPowerEndTime: TableColumnType.int,
                isChangingPowerLine: TableColumnType.int,
                changingPowerLineInfo: TableColumnType.text,
                isAdjacentLines: TableColumnType.int,
                adjacentLinesRemark: TableColumnType.text,
                crossLineInfo: TableColumnType.text,
                hasDoublePowers: TableColumnType.int,
                devicesUnderGround: TableColumnType.int,
                risks: TableColumnType.text,
                riskLevel: TableColumnType.text,
                powerCutDiagram: TableColumnType.text,
                saveLocaTime: TableColumnType.int,
                submitServeTime: TableColumnType.int,
                pictureAttachmentIds: TableColumnType.text,
                syncStatus: TableColumnType.int,
            }
        };
    }

}
